import request from '@/utils/request';

/**
 * 上传文件
 * @param {File} file 文件对象
 * @returns {Promise} 请求结果
 */
export function uploadFile(file) {
  const formData = new FormData();
  formData.append('file', file);
  return request({
    url: '/files/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
} 